<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListHardwareTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListHardwareEmpty}" rendered="#{hardwareController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{hardwareController.items.rowCount > 0}">
                    <h:outputText value="#{hardwareController.pagination.pageFirstItem + 1}..#{hardwareController.pagination.pageLastItem + 1}/#{hardwareController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{hardwareController.previous}" value="#{bundle.Previous} #{hardwareController.pagination.pageSize}" rendered="#{hardwareController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{hardwareController.next}" value="#{bundle.Next} #{hardwareController.pagination.pageSize}" rendered="#{hardwareController.pagination.hasNextPage}"/>&nbsp;
                    <p:dataTable value="#{hardwareController.items}" var="item"    style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHardwareTitle_assembly}"/>
                            </f:facet>
                            <h:outputText value="#{item.assembly}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHardwareTitle_description}"/>
                            </f:facet>
                            <h:outputText value="#{item.description}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHardwareTitle_price}"/>
                            </f:facet>
                            <h:outputText value="#{item.price}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHardwareTitle_supply}"/>
                            </f:facet>
                            <h:outputText value="#{item.supply}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListHardwareTitle_ID}"/>
                            </f:facet>
                            <h:outputText value="#{item.ID}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{hardwareController.prepareView}" value="#{bundle.ListHardwareViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{hardwareController.prepareEdit}" value="#{bundle.ListHardwareEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{hardwareController.destroy}" value="#{bundle.ListHardwareDestroyLink}"/>
                        </h:column>
                    </p:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{hardwareController.prepareCreate}" value="#{bundle.ListHardwareCreateLink}"/>
                <br />
                <br />
                <h:link outcome="/home" value="#{bundle.ListHardwareIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
